<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OrangeCNC - ARISC firmware documentation: mod_stepgen.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OrangeCNC - ARISC firmware documentation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('mod__stepgen_8h.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">mod_stepgen.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>steps generator module header This module implements an API to make real-time step/dir pulses via GPIO  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
<code>#include &quot;<a class="el" href="mod__msg_8h_source.html">mod_msg.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mod__timer_8h_source.html">mod_timer.h</a>&quot;</code><br />
</div>
<p><a href="mod__stepgen_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structstepgen__fifo__slot__t.html">stepgen_fifo_slot_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structstepgen__ch__t.html">stepgen_ch_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:add11bd1a09b296d9990e6dfbca026b2d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#add11bd1a09b296d9990e6dfbca026b2d">STEPGEN_CH_CNT</a>&#160;&#160;&#160;24</td></tr>
<tr class="memdesc:add11bd1a09b296d9990e6dfbca026b2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">maximum number of pulse generator channels  <a href="#add11bd1a09b296d9990e6dfbca026b2d">More...</a><br /></td></tr>
<tr class="separator:add11bd1a09b296d9990e6dfbca026b2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b6853f8439c3d10f952fe92e18100e6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#a1b6853f8439c3d10f952fe92e18100e6">STEPGEN_FIFO_SIZE</a>&#160;&#160;&#160;4</td></tr>
<tr class="memdesc:a1b6853f8439c3d10f952fe92e18100e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">size of channel's fifo buffer  <a href="#a1b6853f8439c3d10f952fe92e18100e6">More...</a><br /></td></tr>
<tr class="separator:a1b6853f8439c3d10f952fe92e18100e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae06fdfb80d84bd2a8eb2a2dd6f6dd94b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#ae06fdfb80d84bd2a8eb2a2dd6f6dd94b">STEPGEN_MSG_BUF_LEN</a>&#160;&#160;&#160;<a class="el" href="mod__msg_8h.html#a1f15293623649a310a7c68ff240f9647">MSG_LEN</a></td></tr>
<tr class="separator:ae06fdfb80d84bd2a8eb2a2dd6f6dd94b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a0411cd49bb5b71852cecd93bcbf0ca2d"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <br />
&#160;&#160;<a class="el" href="mod__stepgen_8h.html#a0411cd49bb5b71852cecd93bcbf0ca2dadeb64ac38a4aa0b61f5a30b0ce10b248">STEPGEN_MSG_PIN_SETUP</a> = 0x20, 
<a class="el" href="mod__stepgen_8h.html#a0411cd49bb5b71852cecd93bcbf0ca2da819acf215bd47a2a09534f42c5134eec">STEPGEN_MSG_TASK_ADD</a>, 
<a class="el" href="mod__stepgen_8h.html#a0411cd49bb5b71852cecd93bcbf0ca2da1277c6bab97058bd73148093308e7531">STEPGEN_MSG_TASK_UPDATE</a>, 
<a class="el" href="mod__stepgen_8h.html#a0411cd49bb5b71852cecd93bcbf0ca2da3004a9efaad2a6f80c34e5f9a1f4bca1">STEPGEN_MSG_ABORT</a>, 
<br />
&#160;&#160;<a class="el" href="mod__stepgen_8h.html#a0411cd49bb5b71852cecd93bcbf0ca2daf6cd7c98ac1fb53dc5d5be7f3a78317d">STEPGEN_MSG_POS_GET</a>, 
<a class="el" href="mod__stepgen_8h.html#a0411cd49bb5b71852cecd93bcbf0ca2daadd2b95fe787b4566197d0077ce8971b">STEPGEN_MSG_POS_SET</a>, 
<a class="el" href="mod__stepgen_8h.html#a0411cd49bb5b71852cecd93bcbf0ca2da4f132c3555be9287960b2ca72552ca11">STEPGEN_MSG_WATCHDOG_SETUP</a>, 
<a class="el" href="mod__stepgen_8h.html#a0411cd49bb5b71852cecd93bcbf0ca2da27323544b34707df604e85d578e67790">STEPGEN_MSG_CNT</a>
<br />
 }</td></tr>
<tr class="separator:a0411cd49bb5b71852cecd93bcbf0ca2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a328fc56e89d3be7b314f773c35206ef3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#a328fc56e89d3be7b314f773c35206ef3">stepgen_module_init</a> ()</td></tr>
<tr class="memdesc:a328fc56e89d3be7b314f773c35206ef3"><td class="mdescLeft">&#160;</td><td class="mdescRight">module init  <a href="#a328fc56e89d3be7b314f773c35206ef3">More...</a><br /></td></tr>
<tr class="separator:a328fc56e89d3be7b314f773c35206ef3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad07cf3fa21b467202e728256fabe57c7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#ad07cf3fa21b467202e728256fabe57c7">stepgen_module_base_thread</a> ()</td></tr>
<tr class="memdesc:ad07cf3fa21b467202e728256fabe57c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">module base thread  <a href="#ad07cf3fa21b467202e728256fabe57c7">More...</a><br /></td></tr>
<tr class="separator:ad07cf3fa21b467202e728256fabe57c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76c18f23772eec1d9d3fb9dd2119487c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#a76c18f23772eec1d9d3fb9dd2119487c">stepgen_pin_setup</a> (uint8_t c, uint8_t type, uint8_t port, uint8_t pin, uint8_t invert)</td></tr>
<tr class="memdesc:a76c18f23772eec1d9d3fb9dd2119487c"><td class="mdescLeft">&#160;</td><td class="mdescRight">setup GPIO pin for the selected channel  <a href="#a76c18f23772eec1d9d3fb9dd2119487c">More...</a><br /></td></tr>
<tr class="separator:a76c18f23772eec1d9d3fb9dd2119487c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52dff69cf40ad614a0997cb69294a3f3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#a52dff69cf40ad614a0997cb69294a3f3">stepgen_task_add</a> (uint8_t c, uint8_t type, uint32_t pulses, uint32_t pin_low_time, uint32_t pin_high_time)</td></tr>
<tr class="memdesc:a52dff69cf40ad614a0997cb69294a3f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">add a new task for the selected channel  <a href="#a52dff69cf40ad614a0997cb69294a3f3">More...</a><br /></td></tr>
<tr class="separator:a52dff69cf40ad614a0997cb69294a3f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1987baf2be40fdf44f84356533516c17"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#a1987baf2be40fdf44f84356533516c17">stepgen_abort</a> (uint8_t c, uint8_t all)</td></tr>
<tr class="memdesc:a1987baf2be40fdf44f84356533516c17"><td class="mdescLeft">&#160;</td><td class="mdescRight">abort all tasks for the selected channel  <a href="#a1987baf2be40fdf44f84356533516c17">More...</a><br /></td></tr>
<tr class="separator:a1987baf2be40fdf44f84356533516c17"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9b0241e054c570a042b70b7a8f2682c"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#af9b0241e054c570a042b70b7a8f2682c">stepgen_pos_get</a> (uint8_t c)</td></tr>
<tr class="memdesc:af9b0241e054c570a042b70b7a8f2682c"><td class="mdescLeft">&#160;</td><td class="mdescRight">set channel steps position  <a href="#af9b0241e054c570a042b70b7a8f2682c">More...</a><br /></td></tr>
<tr class="separator:af9b0241e054c570a042b70b7a8f2682c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a233182090807dad5573d8f3e0654fdd5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#a233182090807dad5573d8f3e0654fdd5">stepgen_pos_set</a> (uint8_t c, int32_t pos)</td></tr>
<tr class="memdesc:a233182090807dad5573d8f3e0654fdd5"><td class="mdescLeft">&#160;</td><td class="mdescRight">set channel steps position  <a href="#a233182090807dad5573d8f3e0654fdd5">More...</a><br /></td></tr>
<tr class="separator:a233182090807dad5573d8f3e0654fdd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afddac7f2ba8476a7d153ea4697c3b9df"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#afddac7f2ba8476a7d153ea4697c3b9df">stepgen_watchdog_setup</a> (uint8_t enable, uint32_t time)</td></tr>
<tr class="memdesc:afddac7f2ba8476a7d153ea4697c3b9df"><td class="mdescLeft">&#160;</td><td class="mdescRight">enable/disable <code>abort all</code> watchdog  <a href="#afddac7f2ba8476a7d153ea4697c3b9df">More...</a><br /></td></tr>
<tr class="separator:afddac7f2ba8476a7d153ea4697c3b9df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea55c383984191341be13404a7e73bb7"><td class="memItemLeft" align="right" valign="top">int8_t volatile&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__stepgen_8h.html#aea55c383984191341be13404a7e73bb7">stepgen_msg_recv</a> (uint8_t type, uint8_t *msg, uint8_t length)</td></tr>
<tr class="memdesc:aea55c383984191341be13404a7e73bb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">"message received" callback  <a href="#aea55c383984191341be13404a7e73bb7">More...</a><br /></td></tr>
<tr class="separator:aea55c383984191341be13404a7e73bb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>steps generator module header This module implements an API to make real-time step/dir pulses via GPIO </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="add11bd1a09b296d9990e6dfbca026b2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add11bd1a09b296d9990e6dfbca026b2d">&#9670;&nbsp;</a></span>STEPGEN_CH_CNT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define STEPGEN_CH_CNT&#160;&#160;&#160;24</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>maximum number of pulse generator channels </p>

</div>
</div>
<a id="a1b6853f8439c3d10f952fe92e18100e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1b6853f8439c3d10f952fe92e18100e6">&#9670;&nbsp;</a></span>STEPGEN_FIFO_SIZE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define STEPGEN_FIFO_SIZE&#160;&#160;&#160;4</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>size of channel's fifo buffer </p>

</div>
</div>
<a id="ae06fdfb80d84bd2a8eb2a2dd6f6dd94b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae06fdfb80d84bd2a8eb2a2dd6f6dd94b">&#9670;&nbsp;</a></span>STEPGEN_MSG_BUF_LEN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define STEPGEN_MSG_BUF_LEN&#160;&#160;&#160;<a class="el" href="mod__msg_8h.html#a1f15293623649a310a7c68ff240f9647">MSG_LEN</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a0411cd49bb5b71852cecd93bcbf0ca2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0411cd49bb5b71852cecd93bcbf0ca2d">&#9670;&nbsp;</a></span>anonymous enum</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a0411cd49bb5b71852cecd93bcbf0ca2dadeb64ac38a4aa0b61f5a30b0ce10b248"></a>STEPGEN_MSG_PIN_SETUP&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0411cd49bb5b71852cecd93bcbf0ca2da819acf215bd47a2a09534f42c5134eec"></a>STEPGEN_MSG_TASK_ADD&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0411cd49bb5b71852cecd93bcbf0ca2da1277c6bab97058bd73148093308e7531"></a>STEPGEN_MSG_TASK_UPDATE&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0411cd49bb5b71852cecd93bcbf0ca2da3004a9efaad2a6f80c34e5f9a1f4bca1"></a>STEPGEN_MSG_ABORT&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0411cd49bb5b71852cecd93bcbf0ca2daf6cd7c98ac1fb53dc5d5be7f3a78317d"></a>STEPGEN_MSG_POS_GET&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0411cd49bb5b71852cecd93bcbf0ca2daadd2b95fe787b4566197d0077ce8971b"></a>STEPGEN_MSG_POS_SET&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0411cd49bb5b71852cecd93bcbf0ca2da4f132c3555be9287960b2ca72552ca11"></a>STEPGEN_MSG_WATCHDOG_SETUP&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0411cd49bb5b71852cecd93bcbf0ca2da27323544b34707df604e85d578e67790"></a>STEPGEN_MSG_CNT&#160;</td><td class="fielddoc"></td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a328fc56e89d3be7b314f773c35206ef3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a328fc56e89d3be7b314f773c35206ef3">&#9670;&nbsp;</a></span>stepgen_module_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void stepgen_module_init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>module init </p>
<dl class="section note"><dt>Note</dt><dd>call this function only once before <a class="el" href="mod__stepgen_8c.html#ad07cf3fa21b467202e728256fabe57c7" title="module base thread ">stepgen_module_base_thread()</a> </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad07cf3fa21b467202e728256fabe57c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad07cf3fa21b467202e728256fabe57c7">&#9670;&nbsp;</a></span>stepgen_module_base_thread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void stepgen_module_base_thread </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>module base thread </p>
<dl class="section note"><dt>Note</dt><dd>call this function in the main loop, before gpio_module_base_thread() </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a76c18f23772eec1d9d3fb9dd2119487c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a76c18f23772eec1d9d3fb9dd2119487c">&#9670;&nbsp;</a></span>stepgen_pin_setup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void stepgen_pin_setup </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>invert</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>setup GPIO pin for the selected channel </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
    <tr><td class="paramname">type</td><td>0:step, 1:dir </td></tr>
    <tr><td class="paramname">port</td><td>GPIO port number </td></tr>
    <tr><td class="paramname">pin</td><td>GPIO pin number </td></tr>
    <tr><td class="paramname">invert</td><td>invert pin state?</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a52dff69cf40ad614a0997cb69294a3f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52dff69cf40ad614a0997cb69294a3f3">&#9670;&nbsp;</a></span>stepgen_task_add()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void stepgen_task_add </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pulses</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin_low_time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin_high_time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>add a new task for the selected channel </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
    <tr><td class="paramname">type</td><td>0:step, 1:dir </td></tr>
    <tr><td class="paramname">pulses</td><td>number of pulses (ignored for DIR task) </td></tr>
    <tr><td class="paramname">pin_low_time</td><td>pin LOW state duration (in nanoseconds) </td></tr>
    <tr><td class="paramname">pin_high_time</td><td>pin HIGH state duration (in nanoseconds)</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a1987baf2be40fdf44f84356533516c17"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1987baf2be40fdf44f84356533516c17">&#9670;&nbsp;</a></span>stepgen_abort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void stepgen_abort </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>all</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>abort all tasks for the selected channel </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
    <tr><td class="paramname">all</td><td>abort all task? </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af9b0241e054c570a042b70b7a8f2682c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af9b0241e054c570a042b70b7a8f2682c">&#9670;&nbsp;</a></span>stepgen_pos_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t stepgen_pos_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set channel steps position </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">integer</td><td>4-bytes </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a233182090807dad5573d8f3e0654fdd5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a233182090807dad5573d8f3e0654fdd5">&#9670;&nbsp;</a></span>stepgen_pos_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void stepgen_pos_set </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>pos</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set channel steps position </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
    <tr><td class="paramname">pos</td><td>integer 4-bytes </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="afddac7f2ba8476a7d153ea4697c3b9df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afddac7f2ba8476a7d153ea4697c3b9df">&#9670;&nbsp;</a></span>stepgen_watchdog_setup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void stepgen_watchdog_setup </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>enable</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>enable/disable <code>abort all</code> watchdog </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">enable</td><td>0 = disable watchdog, other values - enable watchdog </td></tr>
    <tr><td class="paramname">time</td><td>watchdog wait time (in nanoseconds) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aea55c383984191341be13404a7e73bb7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aea55c383984191341be13404a7e73bb7">&#9670;&nbsp;</a></span>stepgen_msg_recv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int8_t volatile stepgen_msg_recv </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>"message received" callback </p>
<dl class="section note"><dt>Note</dt><dd>this function will be called automatically when a new message will arrive for this module.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>user defined message type (0..0xFF) </td></tr>
    <tr><td class="paramname">msg</td><td>pointer to the message buffer </td></tr>
    <tr><td class="paramname">length</td><td>the length of a message (0 .. MSG_LEN)</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>(message read) </td></tr>
    <tr><td class="paramname">-1</td><td>(message not read) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="mod__stepgen_8h.html">mod_stepgen.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
